# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  
  def menu(container, item, pages)
    item_tag, item_opts = [item].flatten;
    container_tag, container_opts = [container].flatten;
    itens = pages.map do |url, content|
      link = content_tag(:a, content, :href => url);
      extra_opts = (request.path == url) ? {:class => "actual"} : {};
      content_tag(item_tag, link, (item_opts || {}).merge(extra_opts));
    end
    content_tag(container_tag, itens.join("\n"), container_opts);    
  end
  
end